3.13.24 \(\int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx\) [1224]

3.13.24.1 Optimal result
3.13.24.2 Mathematica [C] (verified)
3.13.24.3 Rubi [A] (verified)
3.13.24.4 Maple [A] (verified)
3.13.24.5 Fricas [B] (verification not implemented)
3.13.24.6 Sympy [F(-2)]
3.13.24.7 Maxima [B] (verification not implemented)
3.13.24.8 Giac [B] (verification not implemented)
3.13.24.9 Mupad [B] (verification not implemented)

3.13.24.1 Optimal result

Integrand size = 25, antiderivative size = 240 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {(a c+b d) \left (8 a b c d+a^2 \left (c^2-3 d^2\right )-b^2 \left (3 c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {(b c-a d) \left (8 a b c d-b^2 \left (c^2-3 d^2\right )+a^2 \left (3 c^2-d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{2 d^2 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \]

output
(a*c+b*d)*(8*a*b*c*d+a^2*(c^2-3*d^2)-b^2*(3*c^2-d^2))*x/(c^2+d^2)^3-(-a*d+ 
b*c)*(8*a*b*c*d-b^2*(c^2-3*d^2)+a^2*(3*c^2-d^2))*ln(c*cos(f*x+e)+d*sin(f*x 
+e))/(c^2+d^2)^3/f-1/2*(-a*d+b*c)^2*(a+b*tan(f*x+e))/d/(c^2+d^2)/f/(c+d*ta 
n(f*x+e))^2-1/2*(-a*d+b*c)^2*(4*a*c*d+b*(c^2+5*d^2))/d^2/(c^2+d^2)^2/f/(c+ 
d*tan(f*x+e))
 
3.13.24.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 5.78 (sec) , antiderivative size = 327, normalized size of antiderivative = 1.36 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {-\frac {b^2 (b c+a d)}{(c+d \tan (e+f x))^2}-\frac {2 b^2 d (a+b \tan (e+f x))}{(c+d \tan (e+f x))^2}+2 b \left (3 a^2-b^2\right ) d \left (-\frac {i \log (i-\tan (e+f x))}{2 (c+i d)^2}+\frac {i \log (i+\tan (e+f x))}{2 (c-i d)^2}+\frac {d \left (2 c \log (c+d \tan (e+f x))-\frac {c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}\right )+d \left (-3 a^2 b c+b^3 c+a^3 d-3 a b^2 d\right ) \left (\frac {\log (i-\tan (e+f x))}{(-i c+d)^3}+\frac {\log (i+\tan (e+f x))}{(i c+d)^3}+\frac {d \left (\left (6 c^2-2 d^2\right ) \log (c+d \tan (e+f x))-\frac {\left (c^2+d^2\right ) \left (5 c^2+d^2+4 c d \tan (e+f x)\right )}{(c+d \tan (e+f x))^2}\right )}{\left (c^2+d^2\right )^3}\right )}{2 d^2 f} \]

input
Integrate[(a + b*Tan[e + f*x])^3/(c + d*Tan[e + f*x])^3,x]
 
output
(-((b^2*(b*c + a*d))/(c + d*Tan[e + f*x])^2) - (2*b^2*d*(a + b*Tan[e + f*x 
]))/(c + d*Tan[e + f*x])^2 + 2*b*(3*a^2 - b^2)*d*(((-1/2*I)*Log[I - Tan[e 
+ f*x]])/(c + I*d)^2 + ((I/2)*Log[I + Tan[e + f*x]])/(c - I*d)^2 + (d*(2*c 
*Log[c + d*Tan[e + f*x]] - (c^2 + d^2)/(c + d*Tan[e + f*x])))/(c^2 + d^2)^ 
2) + d*(-3*a^2*b*c + b^3*c + a^3*d - 3*a*b^2*d)*(Log[I - Tan[e + f*x]]/((- 
I)*c + d)^3 + Log[I + Tan[e + f*x]]/(I*c + d)^3 + (d*((6*c^2 - 2*d^2)*Log[ 
c + d*Tan[e + f*x]] - ((c^2 + d^2)*(5*c^2 + d^2 + 4*c*d*Tan[e + f*x]))/(c 
+ d*Tan[e + f*x])^2))/(c^2 + d^2)^3))/(2*d^2*f)
 
3.13.24.3 Rubi [A] (verified)

Time = 1.19 (sec) , antiderivative size = 273, normalized size of antiderivative = 1.14, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3042, 4048, 3042, 4111, 27, 3042, 4014, 3042, 4013}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3}dx\)

\(\Big \downarrow \) 4048

\(\displaystyle \frac {\int \frac {d (2 a c+b d) a^2+b (b c-2 a d)^2+b \left (\left (c^2+2 d^2\right ) b^2+a d (2 b c-a d)\right ) \tan ^2(e+f x)+2 d \left (-d a^3+3 b c a^2+3 b^2 d a-b^3 c\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2}dx}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {d (2 a c+b d) a^2+b (b c-2 a d)^2+b \left (\left (c^2+2 d^2\right ) b^2+a d (2 b c-a d)\right ) \tan (e+f x)^2+2 d \left (-d a^3+3 b c a^2+3 b^2 d a-b^3 c\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2}dx}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 4111

\(\displaystyle \frac {\frac {\int \frac {2 \left (d \left (\left (c^2-d^2\right ) a^3+6 b c d a^2-3 b^2 \left (c^2-d^2\right ) a-2 b^3 c d\right )-d \left (2 c d a^3-3 b \left (c^2-d^2\right ) a^2-6 b^2 c d a+b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)\right )}{c+d \tan (e+f x)}dx}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {2 \int \frac {d \left (\left (c^2-d^2\right ) a^3+6 b c d a^2-3 b^2 \left (c^2-d^2\right ) a-2 b^3 c d\right )-d \left (2 c d a^3-3 b \left (c^2-d^2\right ) a^2-6 b^2 c d a+b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 \int \frac {d \left (\left (c^2-d^2\right ) a^3+6 b c d a^2-3 b^2 \left (c^2-d^2\right ) a-2 b^3 c d\right )-d \left (2 c d a^3-3 b \left (c^2-d^2\right ) a^2-6 b^2 c d a+b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 4014

\(\displaystyle \frac {\frac {2 \left (\frac {d x (a c+b d) \left (a^2 c^2-3 a^2 d^2+8 a b c d-3 b^2 c^2+b^2 d^2\right )}{c^2+d^2}-\frac {d (b c-a d) \left (3 a^2 c^2-a^2 d^2+8 a b c d-b^2 c^2+3 b^2 d^2\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}\right )}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 \left (\frac {d x (a c+b d) \left (a^2 c^2-3 a^2 d^2+8 a b c d-3 b^2 c^2+b^2 d^2\right )}{c^2+d^2}-\frac {d (b c-a d) \left (3 a^2 c^2-a^2 d^2+8 a b c d-b^2 c^2+3 b^2 d^2\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}\right )}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

\(\Big \downarrow \) 4013

\(\displaystyle \frac {\frac {2 \left (\frac {d x (a c+b d) \left (a^2 c^2-3 a^2 d^2+8 a b c d-3 b^2 c^2+b^2 d^2\right )}{c^2+d^2}-\frac {d (b c-a d) \left (3 a^2 c^2-a^2 d^2+8 a b c d-b^2 c^2+3 b^2 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )}\right )}{c^2+d^2}-\frac {(b c-a d)^2 \left (4 a c d+b \left (c^2+5 d^2\right )\right )}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 d \left (c^2+d^2\right )}-\frac {(b c-a d)^2 (a+b \tan (e+f x))}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}\)

input
Int[(a + b*Tan[e + f*x])^3/(c + d*Tan[e + f*x])^3,x]
 
output
-1/2*((b*c - a*d)^2*(a + b*Tan[e + f*x]))/(d*(c^2 + d^2)*f*(c + d*Tan[e + 
f*x])^2) + ((2*((d*(a*c + b*d)*(a^2*c^2 - 3*b^2*c^2 + 8*a*b*c*d - 3*a^2*d^ 
2 + b^2*d^2)*x)/(c^2 + d^2) - (d*(b*c - a*d)*(3*a^2*c^2 - b^2*c^2 + 8*a*b* 
c*d - a^2*d^2 + 3*b^2*d^2)*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d 
^2)*f)))/(c^2 + d^2) - ((b*c - a*d)^2*(4*a*c*d + b*(c^2 + 5*d^2)))/(d*(c^2 
 + d^2)*f*(c + d*Tan[e + f*x])))/(2*d*(c^2 + d^2))
 

3.13.24.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && 
 NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
 

rule 4014
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a 
*d)/(a^2 + b^2)   Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; 
FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N 
eQ[a*c + b*d, 0]
 

rule 4048
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*c - a*d)^2*(a + b*Tan[e + f*x])^(m 
 - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - Simp[1 
/(d*(n + 1)*(c^2 + d^2))   Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + 
f*x])^(n + 1)*Simp[a^2*d*(b*d*(m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c 
*(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3*a*b^2*d) 
*Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*( 
n + 1)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[ 
b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 2] && LtQ 
[n, -1] && IntegerQ[2*m]
 

rule 4111
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b^2 - 
 a*b*B + a^2*C)*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1)*(a^2 + b^2))), x 
] + Simp[1/(a^2 + b^2)   Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[b*B + a*(A - 
 C) - (A*b - a*B - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B 
, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0 
]
 
3.13.24.4 Maple [A] (verified)

Time = 0.42 (sec) , antiderivative size = 421, normalized size of antiderivative = 1.75

method result size
derivativedivides \(\frac {\frac {\frac {\left (-3 a^{3} c^{2} d +a^{3} d^{3}+3 a^{2} b \,c^{3}-9 a^{2} b c \,d^{2}+9 a \,b^{2} c^{2} d -3 a \,b^{2} d^{3}-b^{3} c^{3}+3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}{2 d^{2} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a^{3} c \,d^{3}-3 a^{2} b \,c^{2} d^{2}+3 a^{2} b \,d^{4}-6 a \,b^{2} c \,d^{3}+b^{3} c^{4}+3 b^{3} c^{2} d^{2}}{\left (c^{2}+d^{2}\right )^{2} d^{2} \left (c +d \tan \left (f x +e \right )\right )}}{f}\) \(421\)
default \(\frac {\frac {\frac {\left (-3 a^{3} c^{2} d +a^{3} d^{3}+3 a^{2} b \,c^{3}-9 a^{2} b c \,d^{2}+9 a \,b^{2} c^{2} d -3 a \,b^{2} d^{3}-b^{3} c^{3}+3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}}{2 d^{2} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 a^{3} c \,d^{3}-3 a^{2} b \,c^{2} d^{2}+3 a^{2} b \,d^{4}-6 a \,b^{2} c \,d^{3}+b^{3} c^{4}+3 b^{3} c^{2} d^{2}}{\left (c^{2}+d^{2}\right )^{2} d^{2} \left (c +d \tan \left (f x +e \right )\right )}}{f}\) \(421\)
norman \(\frac {\frac {\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) c^{2} x}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}+\frac {d^{2} \left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}-\frac {5 a^{3} c^{2} d^{3}+a^{3} d^{5}-9 a^{2} b \,c^{3} d^{2}+3 a^{2} b c \,d^{4}+3 a \,b^{2} c^{4} d -9 a \,b^{2} c^{2} d^{3}+b^{3} c^{5}+5 b^{3} c^{3} d^{2}}{2 f \,d^{2} \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}-\frac {\left (2 a^{3} c \,d^{3}-3 a^{2} b \,c^{2} d^{2}+3 a^{2} b \,d^{4}-6 a \,b^{2} c \,d^{3}+b^{3} c^{4}+3 b^{3} c^{2} d^{2}\right ) \tan \left (f x +e \right )}{f d \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}+\frac {2 d \left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) c x \tan \left (f x +e \right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) \left (c^{2}+d^{2}\right )}}{\left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}-\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{6}+3 c^{4} d^{2}+3 c^{2} d^{4}+d^{6}\right )}\) \(757\)
risch \(\text {Expression too large to display}\) \(1681\)
parallelrisch \(\text {Expression too large to display}\) \(2023\)

input
int((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^3,x,method=_RETURNVERBOSE)
 
output
1/f*(1/(c^2+d^2)^3*(1/2*(-3*a^3*c^2*d+a^3*d^3+3*a^2*b*c^3-9*a^2*b*c*d^2+9* 
a*b^2*c^2*d-3*a*b^2*d^3-b^3*c^3+3*b^3*c*d^2)*ln(1+tan(f*x+e)^2)+(a^3*c^3-3 
*a^3*c*d^2+9*a^2*b*c^2*d-3*a^2*b*d^3-3*a*b^2*c^3+9*a*b^2*c*d^2-3*b^3*c^2*d 
+b^3*d^3)*arctan(tan(f*x+e)))+(3*a^3*c^2*d-a^3*d^3-3*a^2*b*c^3+9*a^2*b*c*d 
^2-9*a*b^2*c^2*d+3*a*b^2*d^3+b^3*c^3-3*b^3*c*d^2)/(c^2+d^2)^3*ln(c+d*tan(f 
*x+e))-1/2*(a^3*d^3-3*a^2*b*c*d^2+3*a*b^2*c^2*d-b^3*c^3)/d^2/(c^2+d^2)/(c+ 
d*tan(f*x+e))^2-(2*a^3*c*d^3-3*a^2*b*c^2*d^2+3*a^2*b*d^4-6*a*b^2*c*d^3+b^3 
*c^4+3*b^3*c^2*d^2)/(c^2+d^2)^2/d^2/(c+d*tan(f*x+e)))
 
3.13.24.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 861 vs. \(2 (236) = 472\).

Time = 0.28 (sec) , antiderivative size = 861, normalized size of antiderivative = 3.59 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {b^{3} c^{5} - 9 \, a b^{2} c^{4} d - 3 \, a^{2} b c d^{4} - a^{3} d^{5} + 5 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{3} d^{2} - {\left (7 \, a^{3} - 9 \, a b^{2}\right )} c^{2} d^{3} + 2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{5} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{4} d - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{3} d^{2} - {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d^{3}\right )} f x + {\left (b^{3} c^{5} + 3 \, a b^{2} c^{4} d + 9 \, a^{2} b c d^{4} - a^{3} d^{5} - {\left (9 \, a^{2} b - 7 \, b^{3}\right )} c^{3} d^{2} + 5 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} + 2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{3} d^{2} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d^{3} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{4} - {\left (3 \, a^{2} b - b^{3}\right )} d^{5}\right )} f x\right )} \tan \left (f x + e\right )^{2} - {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{5} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{4} d - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{3} d^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} + {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{3} d^{2} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{4} + {\left (a^{3} - 3 \, a b^{2}\right )} d^{5}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{4} d - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{3} d^{2} - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d^{3} + {\left (a^{3} - 3 \, a b^{2}\right )} c d^{4}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (3 \, a b^{2} c^{5} - 3 \, a^{2} b d^{5} - 3 \, {\left (2 \, a^{2} b - b^{3}\right )} c^{4} d + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{3} d^{2} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d^{3} - 3 \, {\left (a^{3} - 2 \, a b^{2}\right )} c d^{4} + 2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{4} d + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{3} d^{2} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} - {\left (3 \, a^{2} b - b^{3}\right )} c d^{4}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{7} d + 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} + c d^{7}\right )} f \tan \left (f x + e\right ) + {\left (c^{8} + 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} + c^{2} d^{6}\right )} f\right )}} \]

input
integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^3,x, algorithm="fricas")
 
output
1/2*(b^3*c^5 - 9*a*b^2*c^4*d - 3*a^2*b*c*d^4 - a^3*d^5 + 5*(3*a^2*b - b^3) 
*c^3*d^2 - (7*a^3 - 9*a*b^2)*c^2*d^3 + 2*((a^3 - 3*a*b^2)*c^5 + 3*(3*a^2*b 
 - b^3)*c^4*d - 3*(a^3 - 3*a*b^2)*c^3*d^2 - (3*a^2*b - b^3)*c^2*d^3)*f*x + 
 (b^3*c^5 + 3*a*b^2*c^4*d + 9*a^2*b*c*d^4 - a^3*d^5 - (9*a^2*b - 7*b^3)*c^ 
3*d^2 + 5*(a^3 - 3*a*b^2)*c^2*d^3 + 2*((a^3 - 3*a*b^2)*c^3*d^2 + 3*(3*a^2* 
b - b^3)*c^2*d^3 - 3*(a^3 - 3*a*b^2)*c*d^4 - (3*a^2*b - b^3)*d^5)*f*x)*tan 
(f*x + e)^2 - ((3*a^2*b - b^3)*c^5 - 3*(a^3 - 3*a*b^2)*c^4*d - 3*(3*a^2*b 
- b^3)*c^3*d^2 + (a^3 - 3*a*b^2)*c^2*d^3 + ((3*a^2*b - b^3)*c^3*d^2 - 3*(a 
^3 - 3*a*b^2)*c^2*d^3 - 3*(3*a^2*b - b^3)*c*d^4 + (a^3 - 3*a*b^2)*d^5)*tan 
(f*x + e)^2 + 2*((3*a^2*b - b^3)*c^4*d - 3*(a^3 - 3*a*b^2)*c^3*d^2 - 3*(3* 
a^2*b - b^3)*c^2*d^3 + (a^3 - 3*a*b^2)*c*d^4)*tan(f*x + e))*log((d^2*tan(f 
*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) + 2*(3*a*b^2*c 
^5 - 3*a^2*b*d^5 - 3*(2*a^2*b - b^3)*c^4*d + 3*(a^3 - 3*a*b^2)*c^3*d^2 + 3 
*(3*a^2*b - b^3)*c^2*d^3 - 3*(a^3 - 2*a*b^2)*c*d^4 + 2*((a^3 - 3*a*b^2)*c^ 
4*d + 3*(3*a^2*b - b^3)*c^3*d^2 - 3*(a^3 - 3*a*b^2)*c^2*d^3 - (3*a^2*b - b 
^3)*c*d^4)*f*x)*tan(f*x + e))/((c^6*d^2 + 3*c^4*d^4 + 3*c^2*d^6 + d^8)*f*t 
an(f*x + e)^2 + 2*(c^7*d + 3*c^5*d^3 + 3*c^3*d^5 + c*d^7)*f*tan(f*x + e) + 
 (c^8 + 3*c^6*d^2 + 3*c^4*d^4 + c^2*d^6)*f)
 
3.13.24.6 Sympy [F(-2)]

Exception generated. \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \]

input
integrate((a+b*tan(f*x+e))**3/(c+d*tan(f*x+e))**3,x)
 
output
Exception raised: AttributeError >> 'NoneType' object has no attribute 'pr 
imitive'
 
3.13.24.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 528 vs. \(2 (236) = 472\).

Time = 0.44 (sec) , antiderivative size = 528, normalized size of antiderivative = 2.20 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{3} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} - {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {2 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{3} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {{\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{3} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {b^{3} c^{5} + 3 \, a b^{2} c^{4} d + 3 \, a^{2} b c d^{4} + a^{3} d^{5} - {\left (9 \, a^{2} b - 5 \, b^{3}\right )} c^{3} d^{2} + {\left (5 \, a^{3} - 9 \, a b^{2}\right )} c^{2} d^{3} + 2 \, {\left (b^{3} c^{4} d + 3 \, a^{2} b d^{5} - 3 \, {\left (a^{2} b - b^{3}\right )} c^{2} d^{3} + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{4}\right )} \tan \left (f x + e\right )}{c^{6} d^{2} + 2 \, c^{4} d^{4} + c^{2} d^{6} + {\left (c^{4} d^{4} + 2 \, c^{2} d^{6} + d^{8}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{5} d^{3} + 2 \, c^{3} d^{5} + c d^{7}\right )} \tan \left (f x + e\right )}}{2 \, f} \]

input
integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^3,x, algorithm="maxima")
 
output
1/2*(2*((a^3 - 3*a*b^2)*c^3 + 3*(3*a^2*b - b^3)*c^2*d - 3*(a^3 - 3*a*b^2)* 
c*d^2 - (3*a^2*b - b^3)*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) 
 - 2*((3*a^2*b - b^3)*c^3 - 3*(a^3 - 3*a*b^2)*c^2*d - 3*(3*a^2*b - b^3)*c* 
d^2 + (a^3 - 3*a*b^2)*d^3)*log(d*tan(f*x + e) + c)/(c^6 + 3*c^4*d^2 + 3*c^ 
2*d^4 + d^6) + ((3*a^2*b - b^3)*c^3 - 3*(a^3 - 3*a*b^2)*c^2*d - 3*(3*a^2*b 
 - b^3)*c*d^2 + (a^3 - 3*a*b^2)*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4* 
d^2 + 3*c^2*d^4 + d^6) - (b^3*c^5 + 3*a*b^2*c^4*d + 3*a^2*b*c*d^4 + a^3*d^ 
5 - (9*a^2*b - 5*b^3)*c^3*d^2 + (5*a^3 - 9*a*b^2)*c^2*d^3 + 2*(b^3*c^4*d + 
 3*a^2*b*d^5 - 3*(a^2*b - b^3)*c^2*d^3 + 2*(a^3 - 3*a*b^2)*c*d^4)*tan(f*x 
+ e))/(c^6*d^2 + 2*c^4*d^4 + c^2*d^6 + (c^4*d^4 + 2*c^2*d^6 + d^8)*tan(f*x 
 + e)^2 + 2*(c^5*d^3 + 2*c^3*d^5 + c*d^7)*tan(f*x + e)))/f
 
3.13.24.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 808 vs. \(2 (236) = 472\).

Time = 0.87 (sec) , antiderivative size = 808, normalized size of antiderivative = 3.37 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left (a^{3} c^{3} - 3 \, a b^{2} c^{3} + 9 \, a^{2} b c^{2} d - 3 \, b^{3} c^{2} d - 3 \, a^{3} c d^{2} + 9 \, a b^{2} c d^{2} - 3 \, a^{2} b d^{3} + b^{3} d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {{\left (3 \, a^{2} b c^{3} - b^{3} c^{3} - 3 \, a^{3} c^{2} d + 9 \, a b^{2} c^{2} d - 9 \, a^{2} b c d^{2} + 3 \, b^{3} c d^{2} + a^{3} d^{3} - 3 \, a b^{2} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac {2 \, {\left (3 \, a^{2} b c^{3} d - b^{3} c^{3} d - 3 \, a^{3} c^{2} d^{2} + 9 \, a b^{2} c^{2} d^{2} - 9 \, a^{2} b c d^{3} + 3 \, b^{3} c d^{3} + a^{3} d^{4} - 3 \, a b^{2} d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{6} d + 3 \, c^{4} d^{3} + 3 \, c^{2} d^{5} + d^{7}} + \frac {9 \, a^{2} b c^{3} d^{4} \tan \left (f x + e\right )^{2} - 3 \, b^{3} c^{3} d^{4} \tan \left (f x + e\right )^{2} - 9 \, a^{3} c^{2} d^{5} \tan \left (f x + e\right )^{2} + 27 \, a b^{2} c^{2} d^{5} \tan \left (f x + e\right )^{2} - 27 \, a^{2} b c d^{6} \tan \left (f x + e\right )^{2} + 9 \, b^{3} c d^{6} \tan \left (f x + e\right )^{2} + 3 \, a^{3} d^{7} \tan \left (f x + e\right )^{2} - 9 \, a b^{2} d^{7} \tan \left (f x + e\right )^{2} - 2 \, b^{3} c^{6} d \tan \left (f x + e\right ) + 24 \, a^{2} b c^{4} d^{3} \tan \left (f x + e\right ) - 14 \, b^{3} c^{4} d^{3} \tan \left (f x + e\right ) - 22 \, a^{3} c^{3} d^{4} \tan \left (f x + e\right ) + 66 \, a b^{2} c^{3} d^{4} \tan \left (f x + e\right ) - 54 \, a^{2} b c^{2} d^{5} \tan \left (f x + e\right ) + 12 \, b^{3} c^{2} d^{5} \tan \left (f x + e\right ) + 2 \, a^{3} c d^{6} \tan \left (f x + e\right ) - 6 \, a b^{2} c d^{6} \tan \left (f x + e\right ) - 6 \, a^{2} b d^{7} \tan \left (f x + e\right ) - b^{3} c^{7} - 3 \, a b^{2} c^{6} d + 18 \, a^{2} b c^{5} d^{2} - 9 \, b^{3} c^{5} d^{2} - 14 \, a^{3} c^{4} d^{3} + 33 \, a b^{2} c^{4} d^{3} - 21 \, a^{2} b c^{3} d^{4} + 4 \, b^{3} c^{3} d^{4} - 3 \, a^{3} c^{2} d^{5} - 3 \, a^{2} b c d^{6} - a^{3} d^{7}}{{\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}^{2}}}{2 \, f} \]

input
integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^3,x, algorithm="giac")
 
output
1/2*(2*(a^3*c^3 - 3*a*b^2*c^3 + 9*a^2*b*c^2*d - 3*b^3*c^2*d - 3*a^3*c*d^2 
+ 9*a*b^2*c*d^2 - 3*a^2*b*d^3 + b^3*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^ 
2*d^4 + d^6) + (3*a^2*b*c^3 - b^3*c^3 - 3*a^3*c^2*d + 9*a*b^2*c^2*d - 9*a^ 
2*b*c*d^2 + 3*b^3*c*d^2 + a^3*d^3 - 3*a*b^2*d^3)*log(tan(f*x + e)^2 + 1)/( 
c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) - 2*(3*a^2*b*c^3*d - b^3*c^3*d - 3*a^3* 
c^2*d^2 + 9*a*b^2*c^2*d^2 - 9*a^2*b*c*d^3 + 3*b^3*c*d^3 + a^3*d^4 - 3*a*b^ 
2*d^4)*log(abs(d*tan(f*x + e) + c))/(c^6*d + 3*c^4*d^3 + 3*c^2*d^5 + d^7) 
+ (9*a^2*b*c^3*d^4*tan(f*x + e)^2 - 3*b^3*c^3*d^4*tan(f*x + e)^2 - 9*a^3*c 
^2*d^5*tan(f*x + e)^2 + 27*a*b^2*c^2*d^5*tan(f*x + e)^2 - 27*a^2*b*c*d^6*t 
an(f*x + e)^2 + 9*b^3*c*d^6*tan(f*x + e)^2 + 3*a^3*d^7*tan(f*x + e)^2 - 9* 
a*b^2*d^7*tan(f*x + e)^2 - 2*b^3*c^6*d*tan(f*x + e) + 24*a^2*b*c^4*d^3*tan 
(f*x + e) - 14*b^3*c^4*d^3*tan(f*x + e) - 22*a^3*c^3*d^4*tan(f*x + e) + 66 
*a*b^2*c^3*d^4*tan(f*x + e) - 54*a^2*b*c^2*d^5*tan(f*x + e) + 12*b^3*c^2*d 
^5*tan(f*x + e) + 2*a^3*c*d^6*tan(f*x + e) - 6*a*b^2*c*d^6*tan(f*x + e) - 
6*a^2*b*d^7*tan(f*x + e) - b^3*c^7 - 3*a*b^2*c^6*d + 18*a^2*b*c^5*d^2 - 9* 
b^3*c^5*d^2 - 14*a^3*c^4*d^3 + 33*a*b^2*c^4*d^3 - 21*a^2*b*c^3*d^4 + 4*b^3 
*c^3*d^4 - 3*a^3*c^2*d^5 - 3*a^2*b*c*d^6 - a^3*d^7)/((c^6*d^2 + 3*c^4*d^4 
+ 3*c^2*d^6 + d^8)*(d*tan(f*x + e) + c)^2))/f
 
3.13.24.9 Mupad [B] (verification not implemented)

Time = 9.41 (sec) , antiderivative size = 466, normalized size of antiderivative = 1.94 \[ \int \frac {(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx=-\frac {\frac {5\,a^3\,c^2\,d^3+a^3\,d^5-9\,a^2\,b\,c^3\,d^2+3\,a^2\,b\,c\,d^4+3\,a\,b^2\,c^4\,d-9\,a\,b^2\,c^2\,d^3+b^3\,c^5+5\,b^3\,c^3\,d^2}{2\,d^2\,\left (c^4+2\,c^2\,d^2+d^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^3\,c\,d^3-3\,a^2\,b\,c^2\,d^2+3\,a^2\,b\,d^4-6\,a\,b^2\,c\,d^3+b^3\,c^4+3\,b^3\,c^2\,d^2\right )}{d\,\left (c^4+2\,c^2\,d^2+d^4\right )}}{f\,\left (c^2+2\,c\,d\,\mathrm {tan}\left (e+f\,x\right )+d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-a^3\,1{}\mathrm {i}+3\,a^2\,b+a\,b^2\,3{}\mathrm {i}-b^3\right )}{2\,f\,\left (-c^3-c^2\,d\,3{}\mathrm {i}+3\,c\,d^2+d^3\,1{}\mathrm {i}\right )}-\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\left (3\,a^2\,b-b^3\right )\,c^3+\left (9\,a\,b^2-3\,a^3\right )\,c^2\,d+\left (3\,b^3-9\,a^2\,b\right )\,c\,d^2+\left (a^3-3\,a\,b^2\right )\,d^3\right )}{f\,\left (c^6+3\,c^4\,d^2+3\,c^2\,d^4+d^6\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-a^3+a^2\,b\,3{}\mathrm {i}+3\,a\,b^2-b^3\,1{}\mathrm {i}\right )}{2\,f\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )} \]

input
int((a + b*tan(e + f*x))^3/(c + d*tan(e + f*x))^3,x)
 
output
- ((a^3*d^5 + b^3*c^5 + 5*a^3*c^2*d^3 + 5*b^3*c^3*d^2 - 9*a*b^2*c^2*d^3 - 
9*a^2*b*c^3*d^2 + 3*a*b^2*c^4*d + 3*a^2*b*c*d^4)/(2*d^2*(c^4 + d^4 + 2*c^2 
*d^2)) + (tan(e + f*x)*(b^3*c^4 + 3*a^2*b*d^4 + 2*a^3*c*d^3 + 3*b^3*c^2*d^ 
2 - 3*a^2*b*c^2*d^2 - 6*a*b^2*c*d^3))/(d*(c^4 + d^4 + 2*c^2*d^2)))/(f*(c^2 
 + d^2*tan(e + f*x)^2 + 2*c*d*tan(e + f*x))) - (log(tan(e + f*x) - 1i)*(a* 
b^2*3i + 3*a^2*b - a^3*1i - b^3))/(2*f*(3*c*d^2 - c^2*d*3i - c^3 + d^3*1i) 
) - (log(c + d*tan(e + f*x))*(c^3*(3*a^2*b - b^3) - d^3*(3*a*b^2 - a^3) + 
c^2*d*(9*a*b^2 - 3*a^3) - c*d^2*(9*a^2*b - 3*b^3)))/(f*(c^6 + d^6 + 3*c^2* 
d^4 + 3*c^4*d^2)) - (log(tan(e + f*x) + 1i)*(3*a*b^2 + a^2*b*3i - a^3 - b^ 
3*1i))/(2*f*(c*d^2*3i - 3*c^2*d - c^3*1i + d^3))